home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: nntp.coast.net!torn!nott!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: Re: need help on direct keyboard input
- Message-ID: <DLz0CF.H1C@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- References: <4ejj1a$bi1@lisa.cs.mcgill.ca>
- Date: Tue, 30 Jan 1996 01:33:51 GMT
-
- In article <4ejj1a$bi1@lisa.cs.mcgill.ca> hus@marge.cs.mcgill.ca (Song HU) writes:
- >Hi,expert:
- > I used programing in Basic language, there is a function name "
- > inkey$", it will get one character from keyboard and do something.
- > now, I would like to make a similar function in C, I try getchar()
- > read() and other input function. they won't process the input unless
- > you press Enter on you keyboard, is there somebody know how can
- > program it in C?
- >
- > Thank you for any suggestion
-
- The C language does not support anything specific for that type
- of input. Each o/s has a specific solution for this. For DOS
- platforms, you can use the non-ANSI function getch() which
- should be available in all DOS compilers. You might also want
- to look at kbhit(). However, your code will not be portable to
- other platforms.
- --
- John A. Grant jagrant@emr1.emr.ca
- Airborne Geophysics
- Geological Survey of Canada, Ottawa
-